package com.yanggu.redisson.domain;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
public class Entry<V> implements Comparable<Entry<V>>, Serializable {

    private Integer priority;

    private V value;

    public Entry(Integer priority, V value) {
        this.priority = priority;
        this.value = value;
    }

    @Override
    public int compareTo(Entry<V> that) {
        return this.priority.compareTo(that.priority);
    }

}